@if(count($writing))
    @foreach($writing as $k =>$v)

        @php
            if(!$v->thumb_img){
                $image=$v->master[0];
        }
         $image=$v->thumb_img;

        @endphp
<li class="timeline__element span6 span12-mobile @if($k%2==0)even @else odd  @endif active"><time class="timeline-case__date span1 span4-mobile"><span class="timeline-case__date--day">{{\Illuminate\Support\Carbon::parse($v->created_at)->day}}</span><span class="timeline-case__date--month">{{trans('datetime.thumb.'.\Illuminate\Support\Carbon::parse($v->created_at)->month)}}</span></time>
    <div class="timeline-case">
        <div class="timeline-case__glitter pixel-pattern clearfix">
            <div class="span5 timeline-case__glitter-img span10-mobile">
                <div class="timeline-case__glitter-img__buttons-container">
                    <a href="{{route('writing_detail',['id'=>$v->id])}}" style="display: block;width: 100%;height: 100%;">
                               
                            </a>
                </div>
                <div class="slider pixel-pattern pixel-pattern--01 pixel-pattern--dark" data-slide="0">
                    <ul class="slider-list">
                        <li class="slider-slide slider-slide--active slider-slide--prev">
                            <a href="{{route('writing_detail',['id'=>$v->id])}}">
                                <img src="{{imagecache('imagecache',['template'=>'large','filename'=>$image])}}" alt="" class="">
                            </a>
                        </li>
                    </ul>
                </div>

            </div>
            <div class="span1 span2-mobile timeline-case__glitter-scorecard">
                <div>
                    <div class="timeline-case__glitter-scorecard__score">
                        <!-- react-text: 1047 -->{{$v->hits or ''}}
                        <!-- /react-text -->
                        <!-- react-text: 1048 -->
                        <!-- /react-text --><small>@lang('web.hits')</small></div>
                    <div class="timeline-case__glitter-scorecard__days">
                        <!-- react-text: 1051 -->{{$v->likes}}
                        <!-- /react-text -->
                        <!-- react-text: 1052 -->
                        <!-- /react-text --><small>@lang('web.likes')</small></div>
                </div>
            </div>
        </div>
        <div class="timeline-case__details clearfix">
            <div class="span5 span10-mobile timeline-case__details-holder ">
                <div class="timeline-case__details-award">
                    <!-- react-text: 1057 -->
                    <!-- /react-text -->
                    <div class="timeline-case__details-award__category">{{trans('web.'.$v->category_id)}}</div>
                </div>
                <h2 class="timeline-case__details__title"><a href="{{route('writing_detail',['id'=>$v->id])}}">{{$v->name or ''}}</a></h2>
                <div class="timeline-case__details__profile"><span class="case-credit"><a class="case-credit__name case-credit__name--faded" href="{{route('his_detail',['id'=>$v->user->id ?? ''])}}">{{$v->user->name or ''}}</a></span>
                </div>
            </div>
            <div class="span1 hide-tablet empty"></div>
        </div>
    </div>
</li>
@endforeach
    @endif